package com.um.jdy.platform.activity.entity.dto;

import com.um.springboot.starter.orm.params.PageDTO;
import com.um.springboot.starter.orm.params.PageParams;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class CouponsPageDTO extends PageDTO {

    @ApiModelProperty(value = "是否生效")
    private String status;

    @ApiModelProperty(value = "优惠券名称")
    private String title;

    @ApiModelProperty(value = "场景类型：Goods-商品优惠券 Charge-充电优惠券")
    private String sceneType;

    @ApiModelProperty(value = "是否对外开放领取：Yes-是 No-否")
    private String isOpen;

    @Override
    public PageParams toPageParams() {
        PageParams pageParams = toPageParams(new String[]{"status","title","sceneType","isOpen"},
                new String[]{"c.status","c.title","c.scene_type","c.is_open"});
        pageParams.getCondition().put("orderby","c.create_time desc");
        return pageParams;
    }
}
